﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MathLab.Utils
{
  class MatrixOperators
  {
    // summing
    public static double[,] operator +(double[,] matrixA, double[,] matrixB)
    {
      return MatrixSum.Sum(matrixA, matrixB);
    }

    public static double[] operator +(double[] matrixA, double[] matrixB)
    {
      return MatrixSum.Sum(matrixA, matrixB);
    }

    //multiplying
    public static double[,] operator *(double[,] matrixA, double[,] matrixB)
    {
      return MatrixMultiply.Multiply(matrixA, matrixB);
    }

    public static double[,] operator *(double[] matrixA, double[] matrixB)
    {
      return MatrixMultiply.Multiply(matrixA, matrixB);
    }

    public static double[,] operator *(double[] vector, double[,] matrix)
    {
      return MatrixMultiply.Multiply(vector, matrix);
    }

    //scalar multiplying
    public static double[] operator *(double[] matrix, double factor)
    {
      return MatrixScalarMultiply.ScalarMultiply(matrix, factor);
    }

    public static double[,] operator *(double[,] matrix, double factor)
    {
      return MatrixScalarMultiply.ScalarMultiply(matrix, factor);
    }
  }
}
